import {DiamondNode, DiamondNodeModel} from "@logicflow/core";

class IfNodeModel extends DiamondNodeModel {

    initNodeData(data) {
        super.initNodeData(data);
        // 设置菱形宽高：rx 表示宽度一半，ry 表示高度一半
        this.rx = 63;
        this.ry = 40;
        this.setProperties({
            nodeType: 'BOOLEAN',
            type: 'BOOLEAN',
            category: 'BOOLEAN',
        });
    }

    getNodeStyle() {
        const style = super.getNodeStyle();
        style.stroke = "#E01E5B"; // 可自定义颜色
        style.fill = "#E01E5B";  // 背景色可选
        return style;
    }

    getTextStyle() {
        return {
            color: '#FFFFFF',     // 设置文字为白色
            fontSize: 14,
            fontWeight: 'bold'
        };
    }

}

class IfNodeView extends DiamondNode {

}

export default {
    type: "BooleanNode",
    view: IfNodeView,
    model: IfNodeModel
};
